<?php


define('DS', DIRECTORY_SEPARATOR);
define('ROOT', dirname(__FILE__));

require_once('application/model/include_dao.php');
require_once('lib/template.class.php');
require_once('lib/html.class.php');
require_once('data.php');
require_once('functions.php');
require_once('config/repositories.php');
require_once('lib/simple_html_dom.php');
//Include google API
require_once('lib/google_api/src/apiClient.php');
require_once('lib/google_api/src/contrib/apiCustomsearchService.php');

//require_once('application/view/Document/add.php');
require_once('application/controller/BaseController.class.php');
require_once('application/controller/CategoriesController.class.php');
require_once('application/controller/FileController.class.php');
require_once('application/controller/KeywordController.class.php');
require_once('application/controller/ProjectsController.class.php');
require_once('application/controller/ProxyController.class.php');
require_once('application/controller/RepositoryController.class.php');
require_once('application/controller/SearchesController.class.php');
require_once('application/controller/SettingsController.class.php');
require_once('application/controller/ShelfController.class.php');
require_once('application/controller/SupplementaryFilesController.class.php');
require_once('application/controller/UsersController.class.php');
require_once('application/controller/DocumentController.class.php');
require_once('application/Messages.class.php');


//Name of the database
$database_name = 'library';
//Also should be included everywhere
ConnectionProperty::$database_path = $database_path;
ConnectionProperty::$database_name = $database_name;







if (!isset($_POST['controller']))
    $_POST['controller'] = "DocumentController";
if (!isset($_POST['model']))
    $_POST['model'] = "DocumentDAO";
if (!isset($_POST['action']))
    $_POST['action'] = "batch";
if (!isset($_POST['parameters']))
    $_POST['parameters'] = array('prm1'=>
    									array("repositories"=>
    											array(	"ieee"=>$request_url_ieee, 
    												  	"arxiv"=>$request_url_arxiv,
    												  	"pubmed_doi"=>$request_url_pubmed_doi,
    													"pubmed_pmid"=>$request_url_pubmed_pmid,
    													"nasa"=>$request_url_nasa,
    													"crossref"=>$request_url_crossref,
    													"springerlink"=>$request_springerlink
    												),
    										"library_path"=>$library_path,
    										"temp_dir"=>$temp_dir));

require_once 'lib/common.php';

